{% if groups['kube_master'] | length == 1 %}
    {% set apiserver = groups['kube_master'][0] + ':' + '6443' %}
{% elif groups['kube_master'] | length > 1 %}
    {% set apiserver = vip + ':' + '16443' %}
{% endif %}

apiVersion: v1
clusters:
- cluster:
    certificate-authority: {{ k8s_link_dir }}/ssl/ca.pem
    server: https://{{ apiserver }}
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kube-proxy
  name: default
current-context: default
kind: Config
preferences: {}
users:
- name: kube-proxy
  user:
    client-certificate: {{ k8s_link_dir }}/ssl/kube-proxy.pem
    client-key: {{ k8s_link_dir }}/ssl/kube-proxy-key.pem
